﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace EngineLayer.Model
{
    using DBLayer;

    public sealed partial class MyApplication //: DBEntities
    {
        private static Entities database; 
        private Library library;
        private User currentUser;
        private CompanyData company;
        

        internal MyApplication(Logon logon)
        { 
            database = new Entities();
            SetUserInfo(logon.user);
            SetLibrary();
            SetCompanyData();
        }

        internal void SetUserInfo(User user)
        {
            this.currentUser = user;
        }
        
        internal void SetLibrary()
        {
            this.library = new Library(this);    
        }

        internal void SetCompanyData()
        {
            this.company = new CompanyData(this);
        }


        public Library Libraries { get { return this.library; } }
        public User CurrentUser { get { return this.currentUser; } }
        internal Entities Database { get { return database; } }

    }
}
